<%@ page import="cn.java79.quiz.entity.Admin" %>
<%@ page import="cn.java79.quiz.service.AdminService" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2022/8/23
  Time: 16:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    String login=request.getParameter("login");
    String pass=request.getParameter("pass");
    Admin admin= AdminService.ME.login(login,pass);
    if(admin!=null){
        session.setAttribute("USER_LOGIN",admin);
        response.sendRedirect("main.jsp");//重定向
        //response.sendRedirect("users.jsp");//重定向
        //request.getRequestDispatcher("users.jsp").forward(request,response);//转发
        return;
    }
%>
登录失败了，<a href="login.jsp">重来</a>
</body>
</html>
